<!doctype html> <html> <head> <meta charset="UTF-8" />
<title>可可宝直播 后台管理中心</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="robots" content="noindex,nofollow">
<link href="/admin/themes/simplebootx/Public/assets/css/admin_login.css" rel="stylesheet" />
<style>			#login_btn_wraper{
	text-align: center;
}
#login_btn_wraper .tips_success{
	color:#fff;
}
#login_btn_wraper .tips_error{
	color:#DFC05D;
}
#login_btn_wraper button:focus{outline:none;}
.btn2{
	width: 35%;
	height: 40px;
	background: #E14946;
	float: right;
	display: inline-block;
	border-radius:10px;
	color: #ffffff;
	text-align: center;
	line-height: 40px;
	margin-right: 15px;
	margin-top: 5px;
	float: left;
}

.code{
	width: 40%;
	height: 100%;
	border: none;
	margin-left: 0px;
	background: #E14946;
	display: inline-block;
	border-radius:10px;
	color: #ffffff;
	text-align: center;
	line-height: 35px;
	margin-top: 5px;
}
</style>
<script>
		if (window.parent !== window.self) {
    document.write = '';
    window.parent.location.href = window.self.location.href;
    setTimeout(function () {
        document.body.innerHTML = '';
    }, 0);
}
</script>
</head>
<body>
<div class="wrap">
	<h2 style="color: #edf4f9;">可可直播 修改登录密码</h2>
	<form method="post" id="from"  action="/index.php?g=admin&m=Public&a=doforgot_password" autoComplete="off" class="js-ajax-form">
		<input type="hidden" name="type" value="forgotten">
		<div class="login">
			<ul>
			  <li>
				<input class="input"  required name="user"  id="user" type="text" placeholder="手机号" title="手机号" value=""/>
			  </li>
			<li>
			<input class="input" id="admin_pwd" type="password" required name="password" placeholder="密码" title="密码" />
			</li>
				<li>
					<input class="input" id="admin_pwd2" type="password" required name="rep_password" placeholder="重复密码" title="密码" />
				</li>
			<li class="verifycode-wrapper">
			<li>
				<input class="input" type="text" name="code" id="code " required placeholder="请输入验证码"  style="width: 120px"/>
				<span class="code" id="verify" >获取验证码</span>
			</li>
			</ul>
			<div id="login_btn_wraper">
				<button type="submit" name="submit" class="btn js-ajax-submit" data-loadingmsg="正在加载...">提交</button>
			</div>
		</div>
	</form>
</div>

<script>
    var GV = {
        DIMAUB: "",
        JS_ROOT: "__PUBLIC__/js/",//js版本号
        TOKEN : ''	//token ajax全局
    };
</script>
<script src="/public/js/wind.js"></script>
<script src="/public/js/jquery.js"></script>
<script type="text/javascript" src="/public/js/common.js"></script>
<script>
    ;(function(){
        document.getElementById('user').focus();
    })();
</script>
<script>

    var is_send = false,interval = null,sleep;


//发送验证码
$('#verify').click(function(){

    var from         = document.getElementById('from');
    var Data         = new  FormData(from);

    var mobile= document.getElementById("user").value;

    if(mobile == ''){
        alert("请输入手机号");
        return false;
    }
    if(!(/^1[3456789]\d{9}$/.test(mobile))){
        alert("手机号码有误，请重填");
        return false;
    }

    if(is_send){
        return false;
    }
    is_send = true;
    sleep = 60;
    if (interval != null) {
        clearInterval(interval);
    }
    interval = setInterval(function () {
        if (sleep <= 0) {
            is_send = false;
            clearInterval(interval);
            interval = null;
            document.getElementById("verify").innerHTML = "重新发送";
        } else {
            document.getElementById("verify").innerHTML = "重新发送(" + sleep-- + ")";
        }
    }, 1000);

    $.ajax({
        url: "http://shop.jianghaishiji.com/api/public/verify",
        type: "POST",
        data: Data,
        processData: false,  // 告诉jQuery不要去处理发送的数据
        contentType: false,  // 告诉jQuery不要去设置Content-Type请求头
        success: function(msg){
			alert(msg);
            var jsonobj = eval(msg);
            alert(jsonobj);
            if(msg.code==-3){
                alert(jsonobj.message);
                return false;
            }else {

				/*   if (msg['code'] ==1 ){
				 window.location.href = '{:U("admin/Product/goods")}';
				 }*/
            }
        },
        error:function(){
          //  alert('网络错误，稍后再试');
        }
    });


    return false;
});
</script> </body> </html>
